<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>PAPI MATLAB Support</title>
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
  <style type="text/css">
<!--
p
{font-family: Verdana, Helvetica, Arial, sans-serif}

.style
{font-family: Verdana, Helvetica, Arial, sans-serif}

td.navBar A:link
{color: #ddd8d2;
font-weight: bold;
text-decoration: none}

td.navBar A:visited
{color: #ccc9c5;
font-weight: bold;
text-decoration: none}

td.navBar A:hover
{color: #ffffff}

.navBar
{color: #77797c;
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size:  11px;
text-transform: uppercase}

a:visited
{color: #50525f}

a:link
{color: #8b3409}

a:hover
{color: #660000}

a:active
{background-color: #b1afad}

.footerNote
{background-color: #ffffff;
background-image: url(images/line.gif);
background-position: right top;
background-repeat: repeat-x;
color: #77797c;
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size:  10px}

BODY
{font-family: Verdana, Helvetica, Arial, sans-serif}
-->
  </style>
  <script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
  </script>
</head>
<body bgcolor="#ffffff" text="#000000" leftmargin="0" topmargin="0"
 marginwidth="0" marginheight="0">
E
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tbody>
    <tr>
      <td valign="top" height="75">
      <table width="100%" border="0" cellspacing="0" cellpadding="0"
 height="75">
        <tbody>
          <tr>
            <td background="images/menubg95.jpg" height="75">
            <table width="760" border="0" cellspacing="0"
 cellpadding="0" align="center" height="75">
              <tbody>
                <tr valign="bottom">
                  <td width="760" align="center" height="50" colspan="2"><img
 src="images/headertop.jpg" width="760" height="50"> </td>
                </tr>
                <tr>
                  <td height="10" align="center" valign="top"
 bgcolor="#333333" width="135"><img src="images/logoleft.jpg"
 width="135" height="25" vspace="0" hspace="0" align="left"> </td>
                  <td class="navBar" height="25" align="center"
 valign="middle" bgcolor="#333333" nowrap="nowrap" width="625"
 background="images/menubg.jpg">
                  <center><a href="http://icl.cs.utk.edu/papi/"> PAPI
HOME </a> </center>
                  </td>
                </tr>
                <tr>
                  <td height="10" align="center" valign="top"
 bgcolor="#ffffff" width="135"><img src="images/logobottom.jpg"
 width="135" height="20" vspace="0" hspace="0" align="left"> </td>
                  <td class="navBar" height="10" align="center"
 valign="bottom" bgcolor="#ffffff" width="625"><img
 src="images/white.jpg" width="625" height="20" vspace="0" hspace="0"
 align="left"> </td>
                </tr>
              </tbody>
            </table>
            </td>
          </tr>
        </tbody>
      </table>
      </td>
    </tr>
    <tr>
      <td valign="top">
      <table width="760" border="0" cellspacing="0" cellpadding="0"
 align="center" class="style">
        <tbody>
          <tr>
            <td class="STYLE">
            <center>
            <h1><i>PAPI MATLAB Support Page</i>
            <hr></h1>
            </center>
            <h2>MATLAB Support</h2>
Two external PAPI functions, <b>flops</b>,<b> </b>and <b>PAPI</b>
, are provided for users of MATLAB. The first function lets you monitor
the number of floating point instructions executed and the
instantaneous
MegaFLOPS rate between any two points in your MATLAB code. The second
provides complete access to the PAPI Higl Level interface. Four m-file
examples
for each function are also included to illustrate the use of these
functions.
These examples can also help you calibrate the performance of your
system.<br>
            <br>
The PAPI mex functions and the supporting m-files are automatically
installed in the folder of your choice by either the specialized PAPI
MATLAB installer or the more complete Windows PAPI installer. In either
case, following the installation you must modify MATLAB's search path
to access these resources.<br>
            <br>
Open MATLAB. Use the <b>File&gt;Set Path...</b> menu command to open
the <b>Set Path</b> dialog. &nbsp;Use the &nbsp;<b>Add Folder...</b>
button to find the <b>PAPI MATLAB Support</b> folder in which the
necessary files reside. It'll usually be in <span
 style="font-weight: bold;">C:\Program Files\ICL\WinPAPI\</span>. When
the folder has been successfully added to the top of your search
path, close the dialog. The PAPI flops function and its supporting
m-files
are now ready for use.<br>
            <br>
The files provided include:
            <h3> Mex External Functions</h3>
            <ul>
              <li><tt> [ops, mflops]= <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI"> flops</a>
                </tt></li>
              <li><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&nbsp; <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI">
PAPI</a> ('num')</tt></li>
              <li><tt>&nbsp; &nbsp;[val, ...]= <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI">
PAPI</a> ('start', 'event', ...)</tt></li>
              <li><tt>&nbsp; &nbsp;[val, ...]= <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI">
PAPI</a> ('stop')</tt></li>
              <li><tt>&nbsp; &nbsp;[val, ...]= <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI">
PAPI</a> ('read')</tt></li>
              <li><tt>&nbsp; &nbsp;[val, ...]= <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI">
PAPI</a> ('accum')</tt></li>
              <li><tt>&nbsp; &nbsp;[ins, ipc]= <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI">
PAPI</a> ('ipc')</tt></li>
              <li><tt> [ins, mflips]= <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI">
PAPI</a> ('flips')</tt></li>
              <li><tt> [ops, mflops]= <a
 href="file:///C:/papi/src/win2k/help/papi_matlab.html#PAPI">
PAPI</a> ('flops')</tt></li>
            </ul>
            <h3> Example M-Files</h3>
            <ul>
              <li><a href="#FlopsInnerProduct"> FlopsInnerProduct.m</a>
              </li>
              <li><a href="#FlopsVectorMatrix"> FlopsMatrix
Vector.m</a> </li>
              <li><a href="#FlopsMatrixMatrix"> FlopsMatrixMatrix.m</a>
              </li>
              <li><a href="#FlopsSampler">FlopsSampler.m</a> </li>
              <li><br>
              </li>
              <li><a href="#PAPIInnerProduct"> PAPIInnerProduct.m</a> </li>
              <li><a href="#PAPIVectorMatrix"> PAPIMatrixVector.m</a> </li>
              <li><a href="#PAPIMatrixMatrix"> PAPIMatrixMatrix.m</a> </li>
            </ul>
            <h1></h1>
            <h2> Mex Functions
            <hr width="100%"></h2>
            <blockquote>
              <h3><a name="flops"></a> NAME</h3>
            </blockquote>
            <blockquote>
              <blockquote><b>flops(0) </b>- Initialize PAPI library,
reset
counters to zero and begin counting.</blockquote>
              <blockquote><b>ops = flops </b>- Return the number of
floating point operations since the first call or last reset.</blockquote>
              <blockquote><b>[ops, mflops] = flops </b>- Return both
the number of floating point operations since the first call or last
reset, and the incremental rate of floating point execution in <b>M</b>ega
                <b>Fl</b> oating Point <b>O</b>perations <b>P</b>er <b>S</b>econd.</blockquote>
              <h3>DESCRIPTION</h3>
              <blockquote>The MATLAB <b>flops </b>function uses the <b>PAPI
                </b><b>P</b>erformance <b>API </b>to do the heavy
lifting. PAPI takes advantage of the fact that most modern
microprocessors have built-in hardware support for counting a variety
of basic operations or events. PAPI uses these counters to track things
like instructions executed, cycles elapsed, floating point instructions
performed and a variety of other events.<br>
The first call to <b>flops </b>will initialize PAPI, set up the
counters to monitor floating point instructions and total cpu cycles,
and start the counters. Subsequent calls will return one or two values.
The first value
is the number of floating point operations since the first call or last
reset. The second optional value, the execution rate in mflops, can
also
be returned. The mflops rate is computed by dividing the operations
since
the last call by the cycles since the last call and multiplying by
cycles
per second:<br>
                <div align="center"><b>mflops = ((ops/cycles)</b><b>
*(cycles/second)</b><b>)/10^6</b><br>
                </div>
The cycles per second value is a derived number determined empirically
by counting cycles for a fixed amount of system time during the
initialization of the PAPI library. Because of the way it is
determined, this value can be
a small but consistent source of systematic error, and can introduce
differences between rates measured by PAPI and those determined by time
measurements, for example, <b>tic </b>and <b>toc.</b> Also note that
PAPI on Windows counts events on a system level rather than a process
or thread level. This can lead
to an over-reporting of cycles, and typically an under-reporting of
mflops.<br>
The flops function continues counting after any call. A call with an
input of 0 resets the counters and returns 0.</blockquote>
              <h3> </h3>
              <h3> ARGUMENTS</h3>
              <blockquote><i>0 </i>-- an optional input argument of 0
will cause the counters to be reset to zero.</blockquote>
              <h3> RETURNS</h3>
              <blockquote><i>ops</i> -- total floating point
instructions since the first call to <b>flops</b><b> </b>or the last
call with an input of 0.
                <p><i>mflops</i> -- Mflop/s achieved since the last
call to <b>flops</b><b>.</b></p>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote>
                <p></p>
              </blockquote>
            </blockquote>
            <center>
            <center>
            <h1>
            <hr></h1>
            </center>
            </center>
            <blockquote>
              <h3><a name="PAPI"></a> NAME</h3>
            </blockquote>
            <blockquote>
              <blockquote><b>ctrs = PAPI('num')</b> - Return the number
of hardware counters.<br>
                <b>PAPI('start', 'event', ...)</b>
- Begin counting the specified events.<br>
                <b>[val, ...] = PAPI('stop')</b> -
Stop counting and return the current values.<br>
                <b>[val, ...] = PAPI('read')</b> -
Read the current values of the active counters.<br>
                <b>[val, ...] = PAPI('accum')</b> -
Add the current values of the active counters to the input values.<br>
                <b>PAPI('ipc')</b> - Begin counting
instructions.<br>
                <b>ins = PAPI('ipc')</b> - Return the
number of instructions executed since the first call.<br>
                <b>[ins, ipc] = PAPI('ipc')</b> - Return
both the total number of instructions executed since the first call,
and
the incremental rate of instruction execution since the last call.<br>
                <b>PAPI('flips')</b><br>
                <b>PAPI('flops')</b> - Begin counting
floating point instructions or operations.<br>
                <b>ins = PAPI('flips')</b><br>
                <b>ops = PAPI('flops')</b> - Return
the number of floating point instructions or operations since the first
call.<br>
                <b>[ins, mflips] = PAPI('flips')</b><br>
                <b>[ops, mflops] = PAPI('flops')</b> - Return both the
number of floating point instructions or operations since
the first call, and the incremental rate of floating point execution
since
since the last call.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <h3>DESCRIPTION</h3>
            </blockquote>
            <blockquote>
              <blockquote>The PAPI function provides
access to the PAPI Performance API. PAPI takes advantage of the fact
that
most modern microprocessors have built-in hardware support for counting
a
variety of basic operations or events. PAPI uses these counters to
track
things like instructions executed, cycles elapsed, floating point
instructions
performed and a variety of other events.<br>
              </blockquote>
              <blockquote>There are 8 subfunctions
within the PAPI call, as described below:<br>
              </blockquote>
              <blockquote><b>'num'&nbsp;&nbsp; </b>- provides
information
on the number of hardware counters built into this platform. The result
of
this call specifies how many events can be counted at once.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote><b>'start' </b>- programs the counters
with the named events and begins counting. The names of the events can
be
found in the PAPI documentation. If a named event cannot be found, or
cannot be mapped, an error message is displayed.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote><b>'stop'&nbsp; </b>- stops counting
and returns the values of the counters in the same order as events were
specified
in the start command. 'stop' also can be used to reset the counters for
the
ipc flips and flops subfunctions described below.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote><b>'read'&nbsp; </b>- return the values of
the counters without stopping them.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote><b>'accum' </b>- adds the values of the
counters to the input parameters and
returns them in the output parameters. Counting is not stopped.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote><b>'ipc'&nbsp;&nbsp; </b>- returns the total
instructions executed since the
first call to this subfunction, and the rate of execution of
instructions
(as instructions per cycle) since the last call.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote><b>'flips' </b>- returns the total floating
point instructions executed since
the first call to this subfunction, and the rate of execution of
floating
point instructions (as mega-floating point instructions per second, or
mflips)
since the last call. A floating point instruction is defined as
whatever
this cpu naturally counts as floating point instructions.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote><b>'flops' </b>- identical to 'flips',
except it measures floating point operations
rather than instructions. In many cases these two counts may be
identical.
In some cases 'flops' will be a derived value that attempts to
reproduce
that which is traditionally considered a floating point operation. For
example,
a fused multiply-add would be counted as two operations, even if it was
only
a single instruction.<br>
              </blockquote>
            </blockquote>
            <blockquote>
              <blockquote>In typical usage, the first five
subfunctions: <b>'num'</b>, <b>'start'</b>
, <b>'stop'</b>, <b>'read'</b>, and <b>'accum'</b> are used
together. <b>
'num'</b> establishes the maximum number of events that can be supplied
to <b>
'start'</b>. After a <b>'start'</b> is issued, <b>'read'</b> and <b>'accum'</b>
can be intermixed until a <b>'stop' </b>is issued.<br>
              </blockquote>
            </blockquote>
            <blockquote>The three rate calls, <b>'ipc'</b>, <b>'flips'</b>,
and <b>'flops'</b> are
intended to be used independently. They cannot be mixed, because they
use
the same counter resources. They can be used serially if they are
separated
by a <b>'stop'</b> call, which can also be used to reset the counters.<br>
            </blockquote>
            <center>
            <h1>
            <hr></h1>
            </center>
            <h2> Example M-Files
            <hr width="100%"></h2>
            <blockquote> </blockquote>
            <blockquote>
              <h3> </h3>
              <h3><b><a name="FlopsInnerProduct"></a> </b>NAME</h3>
              <blockquote><b>FlopsInnerProduct.m</b></blockquote>
              <h3> DESCRIPTION</h3>
              <blockquote>Computes the product of a scalar and a vector
of size n = 50 to 500 in
steps of 50. Displays the observed number of floating point operations
as compared to the theoretically predicted number. Theory predicts ops
= 2*n. The results provide an indication of the overhead incurred by
MATLAB,
and the Mflops acheived for each computation.</blockquote>
              <h3> SOURCE</h3>
              <blockquote><tt>fprintf(1,'\nPAPI Inner Product Test');<br>
fprintf(1,'\nUsing flops');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n',
'difference',
'% error', 'mflops')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(1,n);x=rand(n,1);<br>
&nbsp;&nbsp;&nbsp; flops(0);<br>
&nbsp;&nbsp;&nbsp; c=a*x;<br>
&nbsp;&nbsp;&nbsp; [ops, mflops] = flops;<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.2f\n',n,ops,2*n,ops
- 2*n, (1.0 - ((2*n) / ops)) * 100,mflops)<br>
end</tt><br>
              </blockquote>
              <h3>RESULTS</h3>
              <blockquote>The following were obtained on an 850 MHz
Pentium III running Windows
2000 and MATLAB 6.1. Your milage may vary. <br>
              </blockquote>
              <tt>&gt;&gt; FlopsInnerProduct<br>
              <br>
PAPI Inner Product Test<br>
Using flops<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ops&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2n&nbsp;&nbsp;
difference&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %
error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mflops<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
100&nbsp;&nbsp;&nbsp;&nbsp;&nb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sp;</tt></blockquote>
            <h3>
            <hr width="100%"></h3>
            <blockquote>
              <blockquote>
                <h3><a name="FlopsVectorMatrix"></a>NAME</h3>
              </blockquote>
              <blockquote>
                <blockquote><b>FlopsMatrix</b><b>Vector</b><b>.m</b></blockquote>
              </blockquote>
              <blockquote>
                <h3> DESCRIPTION</h3>
                <blockquote>Computes the product of a square matrix and
a vector of size n = 50 to
500 in steps of 50. Displays the observed number of floating point
operations
as compared to the theoretically predicted number. Theory predicts ops
= 2*n^2. The results provide an indication of the overhead incurred by
MATLAB, and the Mflops acheived for each computation.</blockquote>
                <h3> SOURCE</h3>
                <blockquote><tt>fprintf(1,'\nPAPI Matrix Vector
Multiply Test');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n^2',
'difference',
'% error', 'mflops')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(n);x=rand(n,1);<br>
&nbsp;&nbsp;&nbsp; flops(0);<br>
&nbsp;&nbsp;&nbsp; b=a*x;<br>
&nbsp;&nbsp;&nbsp; [count,mflops]=flops;<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.2f\n',n,count,2*n^2,count
- 2*n^2, (1.0 - ((2*n^2) / count)) * 100,mflops)<br>
end</tt></blockquote>
                <h3>RESULTS</h3>
                <blockquote>The following were obtained on an 850 MHz
Pentium III running Windows
2000 and MATLAB 6.1. Your milage may vary. </blockquote>
              </blockquote>
              <p><tt>&gt;&gt; PAPI Matrix Vector Multiply Test<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ops&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2n^2&nbsp;&nbsp;
difference&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
% error&nbsp;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27&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
51.94<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
320467&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
320000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
467&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
49.36<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
450&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
405583&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
405000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
583&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
43.97<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500711&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
711&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
43.00<br>
&gt;&gt;&nbsp;</tt></p>
            </blockquote>
            <h3>
            <hr width="100%"></h3>
            <blockquote>
              <h3><a name="FlopsMatrixMatrix"></a>NAME</h3>
              <blockquote><b>FlopsMatrixMatrix.m</b></blockquote>
              <h3> DESCRIPTION</h3>
              <blockquote> Computes the product of two square matrices
of size n = 50 to 500 in
steps of 50. Displays the observed number of floating point operations
as compared to the theoretically predicted number. Theory predicts ops
= 2*n^3. MATLAB uses an ATLAS optimized agorithm for peak performance
on
matrix-matrix multiplies. The bulk of the error indicated below is due
to that algorithm, which increases floating point performance while
adding
floating point operations to the theoretically predicted number.</blockquote>
              <h3> SOURCE</h3>
              <blockquote><tt>fprintf(1,'\nPAPI Matrix Matrix Multiply
Test');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n^3',
'difference',
'% error', 'mflops')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(n);b=rand(n);c=rand(n);<br>
&nbsp;&nbsp;&nbsp; flops(0);<br>
&nbsp;&nbsp;&nbsp; c=c+a*b;<br>
&nbsp;&nbsp;&nbsp; [count,mflops]=flops;<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.2f\n',n,count,2*n^3,count
- 2*n^3, (1.0 - ((2*n^3) / count)) * 100,mflops)<br>
end</tt></blockquote>
              <h3>RESULTS</h3>
              <blockquote> The following were obtained on an 850 MHz
Pentium III running Windows 2000 and MATLAB 6.1. Your milage may vary. </blockquote>
              <p><tt>&gt;&gt; FlopsMatrixMatrix<br>
              <br>
PAPI Matrix Matrix Multiply Test<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ops&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2n^3&nbsp;&nbsp;
difference&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
% error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mflops<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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;
182250000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
406368&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 441.02<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 500&nbsp;&nbsp;&nbsp;
250503312&nbsp;&nbsp;&nbsp;
250000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
503312&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 447.54<br>
&gt;&gt;&nbsp;</tt></p>
            </blockquote>
            <h3>
            <hr width="100%"></h3>
            <blockquote>
              <h3><a name="FlopsSampler"></a>NAME</h3>
              <blockquote><b>FlopsSampler.m</b></blockquote>
              <h3> DESCRIPTION</h3>
              <blockquote> Demonstrates the application of the PAPI
flops function on a series of increasingly more computationally
expensive MATLAB operations. &nbsp;You define the size of the
computation with an input parameter; MATLAB displays the operation, the
number of floating point operations required, and the effective Mflop
throughput.<br>
                <br>
              </blockquote>
              <h3> SOURCE</h3>
              <blockquote> The source for this function can be examined
in the file: <br>
PAPISampler.m</blockquote>
              <h3> RESULTS</h3>
              <blockquote> The following were obtained on an 850 MHz
Pentium III running Windows 2000 and MATLAB 6.1. Your milage may vary. </blockquote>
              <p><tt>&gt;&gt; FlopsSampler(500)<br>
              <br>
Counts Using PAPI<br>
              <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Operations&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fl pt ops&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Mfl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&nbsp;&nbsp; 500&nbsp;
4.506011e+009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
146.69<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[x,e]=eig(a)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 500&nbsp;
2.916129e+009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
149.32<br>
&nbsp;&nbsp;&nbsp;
[u,v,x,c,s]=gsvd(a,b)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500&nbsp; 4.756261e+009&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 153.54<br>
&gt;&gt;&nbsp;</tt></p>
              <p><tt><br>
              </tt></p>
              <h3><br>
              </h3>
              <h3><a name="PAPIInnerProduct"></a>NAME</h3>
              <blockquote><b>PAPIInnerProduct.m</b></blockquote>
              <h3> DESCRIPTION</h3>
              <blockquote>Computes the product of a scalar and a vector
of size n = 50 to 500 in
steps of 50 using two different methods: the PAPI('flops') call, and
PAPI('start')
/ PAPI('stop'). Displays the observed number of floating point
operations
as compared to the theoretically predicted number. Theory predicts ops
= 2*n. The results provide an indication of the overhead incurred by
MATLAB,
and the Mflops acheived for each computation.</blockquote>
              <h3> SOURCE</h3>
              <blockquote><tt>fprintf(1,'\n\nPAPI Inner Product Test');<br>
fprintf(1,'\nUsing the High Level PAPI("flops") call');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n',
'difference',
'% error', 'mflops')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(1,n);x=rand(n,1);<br>
&nbsp;&nbsp;&nbsp; PAPI('stop'); % reset the counters to zero<br>
&nbsp;&nbsp;&nbsp; PAPI('flops'); % start counting flops<br>
&nbsp;&nbsp;&nbsp; c=a*x;<br>
&nbsp;&nbsp;&nbsp; [ops, mflops] = PAPI('flops'); % read the flops data<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.2f\n',n,ops,2*n,ops
- 2*n, (1.0 - ((2*n) / ops)) * 100,mflops)<br>
end<br>
PAPI('stop');<br>
                <br>
fprintf(1,'\n\nPAPI Inner Product Test');<br>
fprintf(1,'\nUsing PAPI start and stop');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n',
'difference',
'% error', 'flops/cycle')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(1,n);x=rand(n,1);<br>
&nbsp;&nbsp;&nbsp; PAPI('start', 'PAPI_TOT_CYC', 'PAPI_FP_OPS');<br>
&nbsp;&nbsp;&nbsp; c=a*x;<br>
&nbsp;&nbsp;&nbsp; [cyc, ops] = PAPI('stop');<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.6f\n',n,ops,2*n,ops
- 2*n, (1.0 - ((2*n) / ops)) * 100,ops/cyc)<br>
end</tt></blockquote>
              <h3>RESULTS</h3>
              <blockquote>The following were obtained on an 850 MHz
Pentium III running Windows
2000 and MATLAB 6.1. Your milage may vary. <br>
              </blockquote>
              <tt>&gt;&gt; PAPIInnerProduct<br>
              <br>
              <br>
PAPI Inner Product Test<br>
Using the High Level PAPI("flops") call<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ops&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2n&nbsp;&nbsp;
difference&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; %
error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mflops<br>
&nbsp;&nbsp;&nbsp;&nbsp;&n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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
59&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
5.57&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
27.64<br>
              <br>
              <br>
PAPI Inner Product Test<br>
Using PAPI start and stop<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ops&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2n&nbsp;&nbsp;
difference&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; % error&nbsp; flops/cycle<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
15.97&nbsp;&nbsp;&nbsp;&nbsp;
0.002868<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
223&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
23&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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p;
900&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
55&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
5.76&nbsp;&nbsp;&nbsp;&nbsp;
0.028769<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1059&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
59&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
5.57&nbsp;&nbsp;&nbsp;&nbsp;
0.032066<br>
&gt;&gt;&nbsp;</tt></blockquote>
            <h3>
            <hr width="100%"></h3>
            <blockquote>
              <h3><a name="PAPIVectorMatrix"></a>NAME</h3>
              <blockquote><b>PAPIMatrix</b><b>Vector</b><b>.m</b></blockquote>
              <blockquote>
                <h3> DESCRIPTION</h3>
                <blockquote>Computes the product of a square matrix and
a vector of size n = 50 to
500 in steps of 50 using two different methods: the PAPI('flops') call,
and PAPI('start') / PAPI('stop'). Displays the observed number of
floating
point operations as compared to the theoretically predicted number.
Theory
predicts ops = 2*n^2. The results provide an indication of the overhead
incurred by MATLAB, and the Mflops acheived for each computation.</blockquote>
                <h3> SOURCE</h3>
                <blockquote><tt>fprintf(1,'\nPAPI Matrix Vector
Multiply Test');<br>
fprintf(1,'\nUsing the High Level PAPI("flops") call');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n^2',
'difference',
'% error', 'mflops')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(n);x=rand(n,1);<br>
&nbsp;&nbsp;&nbsp; PAPI('stop'); % reset the counters to zero<br>
&nbsp;&nbsp;&nbsp; PAPI('flops'); % start counting flops<br>
&nbsp;&nbsp;&nbsp; b=a*x;<br>
&nbsp;&nbsp;&nbsp; [count, mflops] = PAPI('flops'); % read the flops
data<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.2f\n',n,count,2*n^2,count
- 2*n^2, (1.0 - ((2*n^2) / count)) * 100,mflops)<br>
end<br>
PAPI('stop');<br>
                  <br>
fprintf(1,'\nPAPI Matrix Vector Multiply Test');<br>
fprintf(1,'\nUsing PAPI start and stop');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n^2',
'difference',
'% error', 'flops/cycle')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(n);x=rand(n,1);<br>
&nbsp;&nbsp;&nbsp; PAPI('start', 'PAPI_TOT_CYC', 'PAPI_FP_OPS');<br>
&nbsp;&nbsp;&nbsp; c=a*x;<br>
&nbsp;&nbsp;&nbsp; [cyc, ops] = PAPI('stop');<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.6f\n',n,ops,2*n^2,ops
- 2*n^2, (1.0 - ((2*n^2) / ops)) * 100,ops/cyc)<br>
end</tt></blockquote>
                <h3>RESULTS</h3>
                <blockquote>The following were obtained on an 850 MHz
Pentium III running Windows
2000 and MATLAB 6.1. Your milage may vary. </blockquote>
              </blockquote>
              <p><tt>&gt;&gt; PAPIMatrixVector<br>
              <br>
PAPI Matrix Vector Multiply Test<br>
Using the High Level PAPI("flops") call<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ops&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2n^2&nbsp;&nbsp;
difference&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.27&nbsp;&nbsp;&nbsp;&nbsp;
0.063880<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
320467&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
320000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
467&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.15&nbsp;&nbsp;&nbsp;&nbsp;
0.059551<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
450&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
405583&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
405000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
583&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.14&nbsp;&nbsp;&nbsp;&nbsp;
0.044170<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500711&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
500000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
711&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.14&nbsp;&nbsp;&nbsp;&nbsp;
0.048029<br>
&gt;&gt;&nbsp;</tt></p>
            </blockquote>
            <h3> </h3>
            <h3>
            <hr width="100%"></h3>
            <blockquote>
              <h3><a name="PAPIMatrixMatrix"></a>NAME</h3>
              <blockquote><b>PAPIMatrixMatrix.m</b></blockquote>
              <h3> DESCRIPTION</h3>
              <blockquote> Computes the product of two square matrices
of size n = 50 to 500 in
steps of 50 using two different methods: the PAPI('flops') call, and
PAPI('start')
/ PAPI('stop'). Displays the observed number of floating point
operations
as compared to the theoretically predicted number. Theory predicts ops
= 2*n^3. MATLAB uses an ATLAS optimized agorithm for peak performance
on
matrix-matrix multiplies. The bulk of the error indicated below is due
to that algorithm, which increases floating point performance while
adding
floating point operations to the theoretically predicted number.</blockquote>
              <h3> SOURCE</h3>
              <blockquote><tt>fprintf(1,'\nPAPI Matrix Matrix Multiply
Test');<br>
fprintf(1,'\nUsing the High Level PAPI("flops") call');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n^3',
'difference',
'% error', 'mflops')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(n);b=rand(n);c=rand(n);<br>
&nbsp;&nbsp;&nbsp; PAPI('stop'); % reset the counters to zero<br>
&nbsp;&nbsp;&nbsp; PAPI('flops'); % start counting flops<br>
&nbsp;&nbsp;&nbsp; c=c+a*b;<br>
&nbsp;&nbsp;&nbsp; [count, mflops] = PAPI('flops'); % read the flops
data<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.2f\n',n,count,2*n^3,count
- 2*n^3, (1.0 - ((2*n^3) / count)) * 100,mflops)<br>
end<br>
PAPI('stop');<br>
                <br>
fprintf(1,'\nPAPI Matrix Matrix Multiply Test');<br>
fprintf(1,'\nUsing PAPI start and stop');<br>
fprintf(1,'\n%12s %12s %12s %12s %12s %12s\n', 'n', 'ops', '2n^3',
'difference',
'% error', 'flops/cycle')<br>
for n=50:50:500,<br>
&nbsp;&nbsp;&nbsp; a=rand(n);b=rand(n);c=rand(n);<br>
&nbsp;&nbsp;&nbsp; PAPI('start', 'PAPI_TOT_CYC', 'PAPI_FP_OPS');<br>
&nbsp;&nbsp;&nbsp; c=c+a*b;<br>
&nbsp;&nbsp;&nbsp; [cyc, ops] = PAPI('stop');<br>
&nbsp;&nbsp;&nbsp; fprintf(1,'%12d %12d %12d %12d %12.2f
%12.6f\n',n,ops,2*n^3,ops
- 2*n^3, (1.0 - ((2*n^3) / ops)) * 100,ops/cyc)<br>
end</tt></blockquote>
              <h3>RESULTS</h3>
              <blockquote> The following were obtained on an 850 MHz
Pentium III running Windows 2000 and MATLAB 6.1. Your milage may vary. </blockquote>
              <p><tt>&gt;&gt; PAPIMatrixMatrix<br>
              <br>
PAPI Matrix Matrix Multiply Test<br>
Using the High Level PAPI("flops") call<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ops&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2n^3&nbsp;&nbsp;
difference&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
% error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mflops<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
258660&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
250000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
8660&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3.35&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
420.75<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2039068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
39068&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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bsp;
437.01<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
350&nbsp;&nbsp;&nbsp;&nbsp;
86007456&nbsp;&nbsp;&nbsp;&nbsp;
85750000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
257456&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
487.16<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 400&nbsp;&nbsp;&nbsp;
128320520&nbsp;&nbsp;&nbsp;
128000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
320520&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 423.99<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 450&nbsp;&nbsp;&nbsp;
182656272&nbsp;&nbsp;&nbsp;
182250000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
406272&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.22&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 459.83<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 500&nbsp;&nbsp;&nbsp;
250503312&nbsp;&nbsp;&nbsp;
250000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
503312&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 453.29<br>
              <br>
PAPI Matrix Matrix Multiply Test<br>
Using PAPI start and stop<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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sp;&nbsp;
16082400&nbsp;&nbsp;&nbsp;&nbsp;
16000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
82400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.51&nbsp;&nbsp;&nbsp;&nbsp;
0.416697<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
250&nbsp;&nbsp;&nbsp;&nbsp;
31379640&nbsp;&nbsp;&nbsp;&nbsp;
31250000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
129640&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.41&nbsp;&nbsp;&nbsp;&nbsp;
0.479208<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
300&nbsp;&nbsp;&nbsp;&nbsp;
54187826&nbsp;&nbsp;&nbsp;&nbsp;
54000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
187826&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.35&nbsp;&nbsp;&nbsp;&nbsp;
0.580607<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
350&nbsp;&nbsp;&nbsp;&nbsp;
86007732&nbsp;&nbsp;&nbsp;&nbsp;
85750000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
257732&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.30&nbsp;&nbsp;&nbsp;&nbsp;
0.457513<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 400&nbsp;&nbsp;&nbsp;
128320260&nbsp;&nbsp;&nbsp;
128000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
320260&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.25&nbsp;&nbsp;&nbsp;&nbsp; 0.545727<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 450&nbsp;&nbsp;&nbsp;
182656419&nbsp;&nbsp;&nbsp;
182250000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
406419&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.22&nbsp;&nbsp;&nbsp;&nbsp; 0.509754<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 500&nbsp;&nbsp;&nbsp;
250503204&nbsp;&nbsp;&nbsp;
250000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
503204&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0.20&nbsp;&nbsp;&nbsp;&nbsp; 0.552343<br>
&gt;&gt;</tt> <tt>&nbsp;</tt></p>
            </blockquote>
            <h3>
            <hr width="100%"></h3>
            <blockquote>
              <h3> </h3>
            </blockquote>
            <p> </p>
            <blockquote>
              <p><tt><br>
              </tt></p>
            </blockquote>
            </td>
          </tr>
        </tbody>
      </table>
      </td>
    </tr>
    <tr>
      <td valign="top">
      <table width="760" border="0" cellspacing="0" cellpadding="5"
 align="center">
        <tbody>
          <tr>
            <td>
            <hr size="1"></td>
          </tr>
          <tr>
            <td height="92">
            <table width="760" border="0" cellspacing="0"
 cellpadding="0" align="center" vspace="0" hspace="0">
              <tbody>
                <tr valign="top">
                  <td align="left" background="images/stripes2.jpg"
 rowspan="2"><br>
                  </td>
                  <td align="right" height="39"
 background="images/stripes2.jpg" width="280"><img
 src="images/trans.gif" width="280" height="63" vspace="0" hspace="0"> </td>
                  <td align="left" height="63" width="200"
 background="images/spinbg.jpg"><a href="http://icl.cs.utk.edu/"
 onmouseout="MM_swapImgRestore()"
 onmouseover="MM_swapImage('Image10','','images/spinlogo.gif',1)"><img
 name="Image10" border="0" src="images/stable.gif" width="200"
 height="63" hspace="0" vspace="0" align="left"
 alt="Innovative Computing Laboratory"> </a> </td>
                  <td align="left" height="0" rowspan="2" valign="top"
 width="140">
                  <div align="left"><img src="images/trans.gif"
 width="140" height="75" border="0" align="left" vspace="0" hspace="0">
                  </div>
                  </td>
                  <td align="left" rowspan="2" valign="top" width="140"><img
 src="images/rd.jpg" width="140" height="75" border="0" align="right"
 vspace="0" hspace="0" alt="2001 R&amp;D Winner"> </td>
                  <td align="right" rowspan="3" valign="top"
 bgcolor="#ffffff"><br>
                  </td>
                </tr>
                <tr valign="top">
                  <td align="center" height="22" rowspan="2"
 valign="top"><span class="FOOTERNOTE"> Contact PAPI: <a
 href="mailto:papi@cs.utk.edu"> papi@cs.utk.edu</a> </span></td>
                  <td align="center" height="11" width="200"><a
 href="http://www.cs.utk.edu/" onmouseout="MM_swapImgRestore()"
 onmouseover="MM_swapImage('Image11','','images/cssigon.gif',1)"><img
 name="Image11" border="0" src="images/cssigoff.gif" width="200"
 height="11" align="left" hspace="0" vspace="0"
 alt="Computer Science Department"> </a> </td>
                </tr>
                <tr valign="top">
                  <td align="left"><br>
                  </td>
                  <td align="center" height="11" width="200"
 valign="top"><a href="http://www.utk.edu/"
 onmouseout="MM_swapImgRestore()"
 onmouseover="MM_swapImage('Image12','','images/utsigon.gif',1)"><img
 name="Image12" border="0" src="images/utsigoff.gif" width="200"
 height="11" vspace="0" hspace="0" align="left"
 alt="University of Tennessee"> </a> </td>
                  <td align="left" height="0" colspan="2" valign="top"><br>
                  </td>
                </tr>
              </tbody>
            </table>
            </td>
          </tr>
        </tbody>
      </table>
      </td>
    </tr>
    <tr>
      <td valign="top"><br>
      </td>
    </tr>
  </tbody>
</table>
</body>
</html>
